home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / content / nsIBindingManager.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  7KB  |  182 lines

  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* ***** BEGIN LICENSE BLOCK *****
  3.  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  4.  *
  5.  * The contents of this file are subject to the Mozilla Public License Version
  6.  * 1.1 (the "License"); you may not use this file except in compliance with
  7.  * the License. You may obtain a copy of the License at
  8.  * http://www.mozilla.org/MPL/
  9.  *
  10.  * Software distributed under the License is distributed on an "AS IS" basis,
  11.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  12.  * for the specific language governing rights and limitations under the
  13.  * License.
  14.  *
  15.  * The Original Code is Mozilla Communicator client code.
  16.  *
  17.  * The Initial Developer of the Original Code is
  18.  * Netscape Communications Corporation.
  19.  * Portions created by the Initial Developer are Copyright (C) 1998
  20.  * the Initial Developer. All Rights Reserved.
  21.  *
  22.  * Contributor(s):
  23.  *   Original Author: David W. Hyatt (hyatt@netscape.com)
  24.  *
  25.  * Alternatively, the contents of this file may be used under the terms of
  26.  * either of the GNU General Public License Version 2 or later (the "GPL"),
  27.  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  28.  * in which case the provisions of the GPL or the LGPL are applicable instead
  29.  * of those above. If you wish to allow use of your version of this file only
  30.  * under the terms of either the GPL or the LGPL, and not to allow others to
  31.  * use your version of this file under the terms of the MPL, indicate your
  32.  * decision by deleting the provisions above and replace them with the notice
  33.  * and other provisions required by the GPL or the LGPL. If you do not delete
  34.  * the provisions above, a recipient may use your version of this file under
  35.  * the terms of any one of the MPL, the GPL or the LGPL.
  36.  *
  37.  * ***** END LICENSE BLOCK ***** */
  38.  
  39. /**
  40.  * Private interface to the XBL Binding.  This interface is currently
  41.  * undergoing deCOMtamination and some methods are only accessible from
  42.  * inside of gklayout.
  43. */
  44.  
  45. #ifndef nsIBinding_Manager_h__
  46. #define nsIBinding_Manager_h__
  47.  
  48. #include "nsISupports.h"
  49.  
  50. class nsIContent;
  51. class nsIDocument;
  52. class nsXBLBinding;
  53. class nsIXBLDocumentInfo;
  54. class nsIAtom;
  55. class nsIStreamListener;
  56. class nsIURI;
  57. class nsIXPConnectWrappedJS;
  58. class nsIDOMNodeList;
  59. class nsVoidArray;
  60.  
  61. #define NS_IBINDING_MANAGER_IID \
  62. { 0x92281eaa, 0x89c4, 0x4457, { 0x8f, 0x8d, 0xca, 0x92, 0xbf, 0xbe, 0x0f, 0x50 } }
  63.  
  64. class nsIBindingManager : public nsISupports
  65. {
  66. public:
  67.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_IBINDING_MANAGER_IID)
  68.  
  69.   virtual nsXBLBinding* GetBinding(nsIContent* aContent) = 0;
  70.   NS_IMETHOD SetBinding(nsIContent* aContent, nsXBLBinding* aBinding) = 0;
  71.  
  72.   NS_IMETHOD GetInsertionParent(nsIContent* aContent, nsIContent** aResult)=0;
  73.   NS_IMETHOD SetInsertionParent(nsIContent* aContent, nsIContent* aResult)=0;
  74.  
  75.   NS_IMETHOD GetWrappedJS(nsIContent* aContent, nsIXPConnectWrappedJS** aResult) = 0;
  76.   NS_IMETHOD SetWrappedJS(nsIContent* aContent, nsIXPConnectWrappedJS* aResult) = 0;
  77.  
  78.   /**
  79.    * Notify the binding manager that an element
  80.    * has been moved from one document to another,
  81.    * so that it can update any bindings or
  82.    * nsIAnonymousContentCreator-created anonymous
  83.    * content that may depend on the document.
  84.    * @param aContent the element that's being moved
  85.    * @param aOldDocument the old document in which the
  86.    *   content resided. May be null if the the content
  87.    *   was not in any document.
  88.    * @param aNewDocument the document in which the
  89.    *   content will reside. May be null if the content
  90.    *   will not reside in any document, or if the
  91.    *   content is being destroyed.
  92.    */
  93.   NS_IMETHOD ChangeDocumentFor(nsIContent* aContent, nsIDocument* aOldDocument,
  94.                                nsIDocument* aNewDocument) = 0;
  95.  
  96.  
  97.   NS_IMETHOD ResolveTag(nsIContent* aContent, PRInt32* aNameSpaceID, nsIAtom** aResult) = 0;
  98.  
  99.   /**
  100.    * Return a list of all explicit children, including any children
  101.    * that may have been inserted via XBL insertion points.
  102.    */
  103.   NS_IMETHOD GetContentListFor(nsIContent* aContent, nsIDOMNodeList** aResult) = 0;
  104.  
  105.   /**
  106.    * Set the insertion point children for the specified element.
  107.    * The binding manager assumes ownership of aList.
  108.    */
  109.   NS_IMETHOD SetContentListFor(nsIContent* aContent, nsVoidArray* aList)=0;
  110.  
  111.   /**
  112.    * Determine whether or not the explicit child list has been altered
  113.    * by XBL insertion points.
  114.    */
  115.   NS_IMETHOD HasContentListFor(nsIContent* aContent, PRBool* aResult) = 0;
  116.  
  117.   /**
  118.    * For a given element, retrieve the anonymous child content.
  119.    */
  120.   NS_IMETHOD GetAnonymousNodesFor(nsIContent* aContent, nsIDOMNodeList** aResult) = 0;
  121.  
  122.   /**
  123.    * Set the anonymous child content for the specified element.
  124.    * The binding manager assumes ownership of aList.
  125.    */
  126.   NS_IMETHOD SetAnonymousNodesFor(nsIContent* aContent, nsVoidArray* aList) = 0;
  127.  
  128.   /**
  129.    * Retrieves the anonymous list of children if the element has one;
  130.    * otherwise, retrieves the list of explicit children. N.B. that if
  131.    * the explicit child list has not been altered by XBL insertion
  132.    * points, then aResult will be null.
  133.    */
  134.   NS_IMETHOD GetXBLChildNodesFor(nsIContent* aContent, nsIDOMNodeList** aResult) = 0;
  135.  
  136.   /**
  137.    * Given a parent element and a child content, determine where the
  138.    * child content should be inserted in the parent element's
  139.    * anonymous content tree. Specifically, aChild should be inserted
  140.    * beneath aResult at the index specified by aIndex.
  141.    */
  142.   virtual nsIContent* GetInsertionPoint(nsIContent* aParent,
  143.                                         nsIContent* aChild,
  144.                                         PRUint32* aIndex) = 0;
  145.  
  146.   /**
  147.    * Return the unfiltered insertion point for the specified parent
  148.    * element. If other filtered insertion points exist,
  149.    * aMultipleInsertionPoints will be set to true.
  150.    */
  151.   virtual nsIContent* GetSingleInsertionPoint(nsIContent* aParent,
  152.                                               PRUint32* aIndex,  
  153.                                               PRBool* aMultipleInsertionPoints) = 0;
  154.  
  155.   NS_IMETHOD AddLayeredBinding(nsIContent* aContent, nsIURI* aURL) = 0;
  156.   NS_IMETHOD RemoveLayeredBinding(nsIContent* aContent, nsIURI* aURL) = 0;
  157.   NS_IMETHOD LoadBindingDocument(nsIDocument* aDocument, nsIURI* aURL,
  158.                                  nsIDocument** aResult) = 0;
  159.  
  160.   NS_IMETHOD AddToAttachedQueue(nsXBLBinding* aBinding)=0;
  161.   NS_IMETHOD ClearAttachedQueue()=0;
  162.   NS_IMETHOD ProcessAttachedQueue()=0;
  163.  
  164.   NS_IMETHOD ExecuteDetachedHandlers()=0;
  165.  
  166.   NS_IMETHOD PutXBLDocumentInfo(nsIXBLDocumentInfo* aDocumentInfo)=0;
  167.   NS_IMETHOD RemoveXBLDocumentInfo(nsIXBLDocumentInfo* aDocumentInfo)=0;
  168.   NS_IMETHOD GetXBLDocumentInfo(nsIURI* aURI, nsIXBLDocumentInfo** aResult)=0;
  169.  
  170.   NS_IMETHOD PutLoadingDocListener(nsIURI* aURL, nsIStreamListener* aListener) = 0;
  171.   NS_IMETHOD GetLoadingDocListener(nsIURI* aURL, nsIStreamListener** aResult) = 0;
  172.   NS_IMETHOD RemoveLoadingDocListener(nsIURI* aURL) = 0;
  173.  
  174.   NS_IMETHOD FlushSkinBindings() = 0;
  175.  
  176.   NS_IMETHOD GetBindingImplementation(nsIContent* aContent, REFNSIID aIID, void** aResult)=0;
  177.  
  178.   NS_IMETHOD ShouldBuildChildFrames(nsIContent* aContent, PRBool* aResult) = 0;
  179. };
  180.  
  181. #endif // nsIBinding_Manager_h__
  182.